﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using PccCommonForC;
using db_ShowRoom;


namespace bs_ShowRoom
{
    public class bs_info : PccCommonForC.BsBaseObject
    {
         string mcon = "";
         public bs_info(string connect)
        {
            mcon = connect;
        }
         private const string COMPONENTNAME = "bs_ShowRoom.bs_info.";
         #region "Function"

         public override string DoReturnStr(string strCommand, string strXML, string strOther)
         {
             string strReturn = "";
             string strStartTime = DateTime.Now.ToString();
             switch (PccToolFunc.Upper(strCommand))
             {
                 case "INSUPDINTRODUCTION":
                     strReturn = bs_InsUpdOIntro(strXML);
                     break;
                 case "INSUPDIMGSLIDE":
                     strReturn = bs_InsUpdImgSlide(strXML);
                     break;
             }
             return strReturn;
         }



         public override DataSet DoReturnDataSet(string strCommand, string strXML, string strOther)
         {
             DataSet dsReturn = null;
             string strReturn = "";
             string strStartTime = DateTime.Now.ToString();

             switch (PccToolFunc.Upper(strCommand))
             {
                 case "GETINTRODUCTION":
                     dsReturn = bs_GetIntro(strXML);
                     break;
                 case "GETIMGSLIDEADMIN":
                     dsReturn = bs_GetImgAdminBySearch(strXML);
                     break;
                    
             }

             if (dsReturn != null)
                 strReturn = "DsFirstTableName---" + dsReturn.Tables[0].TableName;

             return dsReturn;
         }
         #endregion
         private string bs_InsUpdOIntro(string strXML)
         {
             string strReturn;
             db_info mydb = new db_info(mcon);
             strReturn = mydb.db_InsUpdIntroduction(strXML);
             return strReturn;
         }
         private DataSet bs_GetIntro(string strXML)
         {
             db_info mydb = new db_info(mcon);
             DataSet ds = mydb.db_Introduction(strXML);

             return ds;
         }
         private string bs_InsUpdImgSlide(string strXML)
         {
             string strReturn;
             db_info mydb = new db_info(mcon);
             strReturn = mydb.db_InsUpdImg(strXML);
             return strReturn;
         }
         private DataSet bs_GetImgAdminBySearch(string strXML)
         {
             db_info mydb = new db_info(mcon);
             DataSet ds = mydb.db_GetImgAdminBySearch(strXML);
             return ds;
         }
    }
}
